<%@ Register TagPrefix="skm" Namespace="FAQControls" Assembly="FAQControls" %>

<%@ Page Language="c#" Codebehind="PermissionsAdmin.aspx.cs" AutoEventWireup="True"
    Inherits="Adge.Web.Faq.Admin.PermissionsAdmin" %>

<%@ Register Src="../../Controls/faqSitemap.ascx" TagName="faqSitemap" TagPrefix="uc1" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title>skmFAQs.NET :: Permissions Admin</title>
    <link href="../FAQstyle.css" type="text/css" rel="stylesheet">
</head>
<body>
    <form id="Form1" method="post" runat="server">
        <p>
            <skm:LoginPanel ID="LoginPanel1" runat="server" CssClass="faq_logout" />
        </p>
        <h1>
            Permissions Administration</h1>
        <div class="faq_breadcrumb">
            <uc1:faqSitemap id="FaqSitemap1" runat="server">
            </uc1:faqSitemap></div>
        <p>
            <b>Select a User:</b>
            <asp:DropDownList ID="users" runat="server" DataValueField="UserID" DataTextField="Username"
                AutoPostBack="True" OnSelectedIndexChanged="users_SelectedIndexChanged">
            </asp:DropDownList></p>
        <asp:Panel ID="pnlChoosePermissions" runat="server">
            <table class="faq_infoTable" cellpadding="4" rules="all" border="1">
                <tbody>
                    <tr>
                        <th>
                            Available</th>
                        <th>
                            Current</th>
                    </tr>
                    <tr>
                        <td valign="top">
                            <asp:Repeater ID="rptAvailable" runat="server">
                                <HeaderTemplate>
                                    <table cellspacing="0" cellpadding="3">
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <%# PickTRColor(FAQComponents.InvariantString.ToInt32(DataBinder.Eval(Container.DataItem, "GroupID").ToString())) %>
                                    <td height="30">
                                        <%# Adge.UI.WebControls.DGHelpers.DisplayDepth(FAQComponents.InvariantString.ToInt32(DataBinder.Eval(Container.DataItem, "Depth").ToString())) %>
                                        <%# DataBinder.Eval(Container.DataItem, "Name") %>
                                    </td>
                                    <td height="30">
                                        <asp:DropDownList runat="server" ID="role">
                                            <asp:ListItem Value="2">FAQ Editor</asp:ListItem>
                                            <asp:ListItem Value="4">Trusted Contributor</asp:ListItem>
                                            <asp:ListItem Value="8">Contributor</asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <td align="right" height="30">
                                        <asp:LinkButton ID="btnAddPermission" runat="server" CommandName="Add" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "CategoryID") %>'>Add --&gt;</asp:LinkButton>
                                    </td>
                                    </TR>
                                </ItemTemplate>
                                <FooterTemplate>
                                    </TABLE>
                                </FooterTemplate>
                            </asp:Repeater>
                        </td>
                        <td valign="top">
                            <asp:Repeater ID="rptCurrent" runat="server">
                                <HeaderTemplate>
                                    <table cellspacing="0" cellpadding="3">
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <%# PickTRColor(FAQComponents.InvariantString.ToInt32(DataBinder.Eval(Container.DataItem, "GroupID").ToString())) %>
                                    <td height="30">
                                        <asp:LinkButton ID="lnkRemovePermission" runat="server" CommandName="Remove" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "CategoryID") %>'>&lt;-- Remove</asp:LinkButton>
                                    </td>
                                    <td height="30">
                                        <%# Adge.UI.WebControls.DGHelpers.DisplayDepth(FAQComponents.InvariantString.ToInt32(DataBinder.Eval(Container.DataItem, "Depth").ToString()))%>
                                        <%# DisplayPermission(FAQComponents.InvariantString.ToInt32(DataBinder.Eval(Container.DataItem, "CategoryID").ToString()), DataBinder.Eval(Container.DataItem, "Name").ToString()) %>
                                    </td>
                                    </tr>
                                </ItemTemplate>
                                <FooterTemplate>
                                    </table>
                                </FooterTemplate>
                            </asp:Repeater>
                        </td>
                    </tr>
                </tbody>
            </table>
        </asp:Panel>
        <asp:Label ID="messageForAdmins" runat="server" Font-Italic="True">This user is an administrator, and has total access to all FAQs in all categories.</asp:Label></form>
</body>
</html>
